class CurrentWeather7DaysModel {
  String? code;
  String? updateTime;
  String? fxLink;
  List<Daily>? daily;
  Refer? refer;

  CurrentWeather7DaysModel(
      {this.code, this.updateTime, this.fxLink, this.daily, this.refer});

  CurrentWeather7DaysModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    updateTime = json['updateTime'];
    fxLink = json['fxLink'];
    if (json['daily'] != null) {
      daily = <Daily>[];
      json['daily'].forEach((v) {
        daily!.add(Daily.fromJson(v));
      });
    }
    refer = json['refer'] != null ? Refer.fromJson(json['refer']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['code'] = code;
    data['updateTime'] = updateTime;
    data['fxLink'] = fxLink;
    if (daily != null) {
      data['daily'] = daily!.map((v) => v.toJson()).toList();
    }
    if (refer != null) {
      data['refer'] = refer!.toJson();
    }
    return data;
  }
}

class Daily {
  String? fxDate;
  String? sunrise;
  String? sunset;
  String? moonrise;
  String? moonset;
  String? moonPhase;
  String? moonPhaseIcon;
  String? tempMax;
  String? tempMin;
  String? iconDay;
  String? textDay;
  String? iconNight;
  String? textNight;
  String? wind360Day;
  String? windDirDay;
  String? windScaleDay;
  String? windSpeedDay;
  String? wind360Night;
  String? windDirNight;
  String? windScaleNight;
  String? windSpeedNight;
  String? humidity;
  String? precip;
  String? pressure;
  String? vis;
  String? cloud;
  String? uvIndex;

  Daily(
      {this.fxDate,
        this.sunrise,
        this.sunset,
        this.moonrise,
        this.moonset,
        this.moonPhase,
        this.moonPhaseIcon,
        this.tempMax,
        this.tempMin,
        this.iconDay,
        this.textDay,
        this.iconNight,
        this.textNight,
        this.wind360Day,
        this.windDirDay,
        this.windScaleDay,
        this.windSpeedDay,
        this.wind360Night,
        this.windDirNight,
        this.windScaleNight,
        this.windSpeedNight,
        this.humidity,
        this.precip,
        this.pressure,
        this.vis,
        this.cloud,
        this.uvIndex});

  Daily.fromJson(Map<String, dynamic> json) {
    fxDate = json['fxDate'];
    sunrise = json['sunrise'];
    sunset = json['sunset'];
    moonrise = json['moonrise'];
    moonset = json['moonset'];
    moonPhase = json['moonPhase'];
    moonPhaseIcon = json['moonPhaseIcon'];
    tempMax = json['tempMax'];
    tempMin = json['tempMin'];
    iconDay = json['iconDay'];
    textDay = json['textDay'];
    iconNight = json['iconNight'];
    textNight = json['textNight'];
    wind360Day = json['wind360Day'];
    windDirDay = json['windDirDay'];
    windScaleDay = json['windScaleDay'];
    windSpeedDay = json['windSpeedDay'];
    wind360Night = json['wind360Night'];
    windDirNight = json['windDirNight'];
    windScaleNight = json['windScaleNight'];
    windSpeedNight = json['windSpeedNight'];
    humidity = json['humidity'];
    precip = json['precip'];
    pressure = json['pressure'];
    vis = json['vis'];
    cloud = json['cloud'];
    uvIndex = json['uvIndex'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['fxDate'] = fxDate;
    data['sunrise'] = sunrise;
    data['sunset'] = sunset;
    data['moonrise'] = moonrise;
    data['moonset'] = moonset;
    data['moonPhase'] = moonPhase;
    data['moonPhaseIcon'] = moonPhaseIcon;
    data['tempMax'] = tempMax;
    data['tempMin'] = tempMin;
    data['iconDay'] = iconDay;
    data['textDay'] = textDay;
    data['iconNight'] = iconNight;
    data['textNight'] = textNight;
    data['wind360Day'] = wind360Day;
    data['windDirDay'] = windDirDay;
    data['windScaleDay'] = windScaleDay;
    data['windSpeedDay'] = windSpeedDay;
    data['wind360Night'] = wind360Night;
    data['windDirNight'] = windDirNight;
    data['windScaleNight'] = windScaleNight;
    data['windSpeedNight'] = windSpeedNight;
    data['humidity'] = humidity;
    data['precip'] = precip;
    data['pressure'] = pressure;
    data['vis'] = vis;
    data['cloud'] = cloud;
    data['uvIndex'] = uvIndex;
    return data;
  }
}

class Refer {
  List<String>? sources;
  List<String>? license;

  Refer({this.sources, this.license});

  Refer.fromJson(Map<String, dynamic> json) {
    sources = json['sources'].cast<String>();
    license = json['license'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['sources'] = sources;
    data['license'] = license;
    return data;
  }
}
